---
# Configuration for the notifications consumer

- name: install needed packages
  yum: pkg={{ item }} state=present
  with_items:
  - python-fmn-consumer
  - python-psycopg2
  - libsemanage-python
  # Needed to produce nice long emails about koji builds
  - koji
  tags:
  - notifs
  - notifs/backend

- name: copy database configuration
  template: >
    src={{ item }} dest=/etc/fedmsg.d/{{ item }}
    owner=fedmsg group=fedmsg mode=0600
  with_items:
  - fmn.consumer.py
  notify:
  - restart fedmsg-hub
  tags:
  - notifs
  - notifs/backend

- name: copy the alembic configuration for DBAs
  template: >
    src=alembic.ini dest=/usr/share/fmn.lib/alembic.ini
    owner=root group=sysadmin-dba mode=0660
  notify:
  - restart fedmsg-hub
  tags:
  - notifs
  - notifs/backend

- name: copy over admin utility scripts
  synchronize: src=bin/ dest=/usr/local/bin/
  tags:
  - notifs
  - notifs/backend

- name: override the default syslog logrotate file
  copy: src=syslog-logrotate dest=/etc/logrotate.d/syslog
  tags:
  - notifs
  - notifs/backend
